#include "stdafx.h"
#include "_CsvIO.h"

namespace CsvIO
{
    void toCSV(_GraphData* pGraph, CString& Csv)
    {
        Csv.Format(L"%s X;%s Y\r\n", pGraph->m_Title, pGraph->m_Title);

        for(_u32 i = 0; i < pGraph->m_Points.size(); i++)
        {
            auto Point = pGraph->m_Points.at(i);
            Csv.AppendFormat(L"%lf;%lf\r\n", Point.m_X, Point.m_Y);
        }
    }

    _GraphData fromCSV(CString Csv);
}
